# Configure BOOST Library Directory
isEmpty(BOOST_ROOT) {
    BOOST_ROOT = $${PWD}/../../../sdk/boost
}

# Configure BOOST INCLUDEPATH
INCLUDEPATH += $${BOOST_ROOT}/include
# tell lupdate to exclude boost library files and avoid 100% bug of CPU when using lupdate
TR_EXCLUDE += $$BOOST_ROOT/include/*

# if set MAPLE_BOOST_HEADER_ONLY = true then not add static libraries
!contains(MAPLE_BOOST_HEADER_ONLY,true){

    # Configure BOOST Library PREFIX & SUFFIX
    isEmpty(BOOST_LIB_PREFIX) {
        BOOST_LIB_PREFIX = boost_
    }

    win32 {
        CONFIG(release, debug|release){
          BOOST_LIB_SUFFIX = -mgw49-mt-s-x32-1_69
        }
        CONFIG(debug, debug|release){
          BOOST_LIB_SUFFIX = -mgw49-mt-sd-x32-1_69
        }
    }

    unix{
        CONFIG(release, debug|release){
            if(contains(DEFINES,MAPLE_CPU_ARCH_ARM)){
                BOOST_LIB_SUFFIX = -mt-s-a64
            }else{
                if(contains(DEFINES,MAPLE_CPU_ARCH_MIPS)){
                    BOOST_LIB_SUFFIX = -mt-s
                }else{
                    BOOST_LIB_SUFFIX = -mt-s-x64
                }
            }
        }
        CONFIG(debug, debug|release){
            if(contains(DEFINES,MAPLE_CPU_ARCH_ARM)){
                BOOST_LIB_SUFFIX = -mt-sd-a64
            }else{
                if(contains(DEFINES,MAPLE_CPU_ARCH_MIPS)){
                    BOOST_LIB_SUFFIX = -mt-sd
                }else{
                    BOOST_LIB_SUFFIX = -mt-sd-x64
                }
            }
        }
    }

    isEmpty(BOOST_LIB_SUFFIX){
      error("Please set BOOST_LIB_SUFFIX")
    }

    # Configure BOOST Required Static Libraries
    LIBS += -lpthread
    win32 {
        LIBS += -lgdi32
        LIBS += -lwsock32
        LIBS += -lws2_32
        #LIBS += -liconv
    }
    unix {
        LIBS += -ldl    #Linux System Lib
    }

    isEmpty(BOOST_LIBS) {
        BOOST_LIBS = filesystem locale  #BOOST_LIBS = date_time system filesystem locale random thread program_options
    }

    # Configure BOOST Required DEFINES
    unix{
        #add DEFINE BOOST_LOCALE_HIDE_AUTO_PTR for warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
        #https://github.com/boostorg/locale/issues/27
        DEFINES += BOOST_LOCALE_HIDE_AUTO_PTR
    }

    # Configure BOOST LIBS
    LIBS += -L$${BOOST_ROOT}/lib/
    for(lib, BOOST_LIBS) {
    #  message(link: $${BOOST_LIB_PREFIX}$${lib}$${BOOST_LIB_SUFFIX})
      LIBS += -l$${BOOST_LIB_PREFIX}$${lib}$${BOOST_LIB_SUFFIX}
    }

}







